package shark.picture.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import shark.picture.data.dto.picture.PictureQueryRequest;
import shark.picture.data.dto.picture.PictureReviewRequest;
import shark.picture.data.dto.picture.PictureUploadByBatchRequest;
import shark.picture.data.dto.picture.PictureUploadRequest;
import shark.picture.data.entity.Picture;
import com.baomidou.mybatisplus.extension.service.IService;
import shark.picture.data.entity.User;
import shark.picture.data.vo.picture.PictureVO;

import javax.servlet.http.HttpServletRequest;

/**
* @author jianxin.wei
* @description 针对表【picture(图片)】的数据库操作Service
* @createDate 2025-03-21 10:09:50
*/
public interface PictureService extends IService<Picture> {
    // 上传图片
    PictureVO uploadPicture(Object inputSource, PictureUploadRequest pictureUploadRequest, User loginUser);

//    /**
//     * 上传图片
//     *
//     * @param multipartFile
//     * @param pictureUploadRequest
//     * @param loginUser
//     * @return
//     */
//    PictureVO uploadPicture(MultipartFile multipartFile,
//                            PictureUploadRequest pictureUploadRequest,
//                            User loginUser);

//    PictureVO uploadStreamPicture(MultipartFile multipartFile, PictureUploadRequest pictureUploadRequest, User loginUser);


    QueryWrapper<Picture> getQueryWrapper(PictureQueryRequest pictureQueryRequest);

    PictureVO getPictureVO(Picture picture, HttpServletRequest request);

    Page<PictureVO> getPictureVOPage(Page<Picture> picturePage, HttpServletRequest request);

    void validPicture(Picture picture);

    /**
     * 图片审核
     *
     * @param pictureReviewRequest
     * @param loginUser
     */
    void doPictureReview(PictureReviewRequest pictureReviewRequest, User loginUser);

    void fillReviewParams(Picture picture, User loginUser);

    /**
     * 批量抓取和创建图片
     *
     * @param pictureUploadByBatchRequest
     * @param loginUser
     * @return 成功创建的图片数
     */
    Integer uploadPictureByBatch(
            PictureUploadByBatchRequest pictureUploadByBatchRequest,
            User loginUser
    );

}
